package com.ft.oa.domain.customer;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ft.oa.domain.Attachment;
import com.ft.oa.domain.dto.knowledgeBase.AttachmentDto;
import com.ft.oa.utils.SecurityUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "customer_supplier",autoResultMap = true)
public class CustomerSupplier {

  /**
   * 供应商id
   */
  @TableId(type = IdType.AUTO)
  private Integer id;
  /**
   * 供应商名称
   */
  private String supplierName;
  /**
   * 联系人
   */
  private String linkman;
  /**
   * 联系电话
   */
  private String phone;
  /**
   * 重要程度
   */
  private Integer importance;
  /**
   * 合作状态
   */
  private Integer cooperation;
  /**
   * 主营业务
   */
  private String business;
  /**
   * 备注信息
   */
  private String remark;
  /**
   * 创建人id
   */
  private Long creator = SecurityUtils.getCurrentUser().getId();

  /**
   * 创建时间
   */
  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
  private LocalDateTime createTime = LocalDateTime.now();

  /**
   * 修改时间
   */
  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
  private LocalDateTime updateTime = LocalDateTime.now();

  /**
   * 修改人id
   */
  private Long editor = SecurityUtils.getCurrentUser().getId();
  /**
   * 数据状态 0：存在 1：删除
   */
  private Integer state;

  @TableField(exist = false)
  private List<AttachmentDto> attachments;

  private String achment;

  @TableField(exist = false)
  private List<Attachment> attachment;

}
